package com.itheima.controller;

import com.itheima.pojo.ChangePwd;
import com.itheima.pojo.Result;
import com.itheima.service.EmpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

//修改密码的控制器

@Slf4j
@RestController
public class ChangePwdController {

    @Autowired
    private EmpService empService;

    //修改密码
    @PostMapping("/change")
    public Result changePwd(@RequestBody ChangePwd changePwd){
        log.info("修改密码，{}", changePwd);
        empService.changePwd(changePwd);
        return Result.success();
    }
}
